//
//  JiangdaoListTableViewCell.m
//  JiuKuGospel
//
//  Created by jiukuyinyue on 16/8/3.
//  Copyright (c) 2016年 JiuKuForApp. All rights reserved.
//

#import "JiangdaoListTableViewCell.h"
#define TOP 8

@implementation JiangdaoListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)setStatus:(NSDictionary *)status
{
    [self setupUI:status];
}

- (void)setupUI:(NSDictionary *)status
{
    [self.allView removeFromSuperview];
    self.allView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    [self addSubview:_allView];
    
    self.numLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, _allView.height)];
    _numLabel.textAlignment = NSTextAlignmentCenter;
    _numLabel.font = FONT_18;
    [_allView addSubview:_numLabel];
    
    self.picImage = [[UIImageView alloc] initWithFrame:CGRectMake(_numLabel.right, TOP, _allView.height-2*TOP, _allView.height-2*TOP)];
    [_picImage sd_setImageWithURL:[status objectForKey:@"pic"] placeholderImage:[UIImage imageNamed:@"450x450@3x.png"]];
    [_allView addSubview:_picImage];
    
    self.songNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_picImage.right+5, TOP, _allView.width-_picImage.right-5-3, _picImage.height)];
    _songNameLabel.font = FONT_16;
    _songNameLabel.text = [status objectForKey:@"title"];
    [_allView addSubview:_songNameLabel];
    
    
//    UITapGestureRecognizer * downLoadTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(downLoadAction)];
//    UIView * downLoadView = [[UIView alloc] initWithFrame:CGRectMake(_allView.width-40, 0, 40, _allView.height)];
//    [downLoadView addGestureRecognizer:downLoadTap];
//    [_allView addSubview:downLoadView];
//    //    UIImageView * downLoadImageView = [[UIImageView alloc] initWithFrame:CGRectMake((downLoadView.width-15)/2, (downLoadView.height-15)/2, 15, 15)];
//    UIImageView * downLoadImageView = [[UIImageView alloc] initWithFrame:CGRectMake((downLoadView.width-20)/2, (downLoadView.height-20)/2, 20, 20)];
//    
//    downLoadImageView.image = [UIImage imageNamed:@"list_download@3x.png"];
//    [downLoadView addSubview:downLoadImageView];
    
}


//- (void)downLoadAction
//{
//    NSLog(@"downLoad");
//    [self.target performSelector:self.action withObject:[NSString stringWithFormat:@"%ld", self.index]];
//    
//}

@end
